<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="../../attr.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!doctype html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="utf-8">
    <link rel="stylesheet" href="${ctx}/css/sapar.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/common.css"/>
    <script type="text/javascript" src="${ctx}/js/jquery.js"></script>
    <script type="text/javascript" src="${ctx}/js/sapar.js"></script>
    <script type="text/javascript" src="${ctx}/js/WdatePicker.js"></script>
    <script type="text/javascript" src="${ctx}/assets/layer/layer.js"></script>
    <script type="text/javascript" src="${ctx}/js/kkpager.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/kkpager_blue.css"/>
    <title>编辑清洗</title>
</head>

<body>
<div id="saper-container">
    <div id="saper-hd"></div>
    <div id="saper-bd">
        <div class="subfiled clearfix">
            <h2>编辑清洗批次</h2>
        </div>
        <div class="subfiled-content">
            <form class="saper-form" id="dataForm">
                <div class="kv-item clearfix">
                    <label><span class="impInfo">*</span>清洗机器：</label>
                    <div class="kv-item-content">

                        <select name="qingxiShebeiTiaoma" >
                            <option value="">请选择</option>
                            <c:if test="${zsEquips != null}">
                                <c:forEach items="${zsEquips}" var="zsEquip">
                                    <option value="${zsEquip.equipId}"
                                            <c:if test="${zsEquip.equipId==zsQingxi.qingxiShebeiTiaoma}">selected</c:if>>${zsEquip.equipName}</option>
                                </c:forEach>
                            </c:if>
                        </select>
                        <%--<input type="text"  placeholder="清洗机器" class="txt_required" name="qingxiShebeiTiaoma"--%>
                               <%--value="${zsQingxi.qingxiShebeiTiaoma}">--%>
                    </div>
                </div>
                <div class="kv-item clearfix">
                    <label><span class="impInfo">*</span>清洗软件：</label>
                    <div class="kv-item-content">
                        <input type="text" readonly placeholder="清洗软件" class="txt_required"
                               value="${zsQingxi.qingxiRuanjianName}">
                    </div>
                </div>

                <div class="kv-item clearfix">
                    <label><span class="impInfo">*</span>清洗人：</label>
                    <div class="kv-item-content">
                        <input type="text" readonly placeholder="清洗人" class="txt_required"
                               value="${emMap[zsQingxi.qingxiQingxirenTiaoma]}">
                    </div>
                </div>

                <div class="buttons">
                    <a href="javascript:;" class="sapar-btn sapar-btn-recom">确定</a>
                    <input name="qingxiLiushui" type="hidden" value="${zsQingxi.qingxiLiushui}">
                </div>
            </form>
        </div>
    </div>
    <div id="saper-ft"></div>
</div>

</body>

<script type="text/javascript">
    $(function () {
        $(".sapar-btn-recom").click(function () {
            var btn = true;
            $(".txt_required").each(function () {
                if ($(this).val() == '') {
                    btn = false;
                    layer.msg("必填项不为空");
                    return false;
                }
            });
            if (btn) {
                $.ajax({
                    type: "POST",
                    url: "${ctx}/qingxi/qingxiEditSave.do",
                    data: $('#dataForm').serialize(),// 你的formid
                    error: function (request) {
                        layer.alert("网络故障，请稍后再试!");
                    },
                    success: function (data) {
                        if (data.status == "true") {
                            layer.alert("保存成功", function () {
                                window.location.href = "${ctx}/qingxi/qingxiList.do";
                            });
                        } else {
                            layer.msg(data.msg);
                        }
                    }
                });
            }
        });
    });

</script>
</html>